home *** CD-ROM | disk | FTP | other *** search
/ CDUTIL 13 / CDUTIL #13 Julio 1995.iso / windows / acadwin / ads / cpp / helloads / mainwnd.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-08  |  3.2 KB  |  86 lines

  1. /* 
  2.     MAINWND.H -
  3.     
  4.     This file:
  5.  
  6.         Declares basic WINDOW object and MAINWDOW object.
  7.  
  8.     (C) Copyright 1988-1994 by Autodesk, Inc.
  9.  
  10.     This program is copyrighted by Autodesk, Inc. and is  licensed
  11.     to you under the following conditions.  You may not distribute
  12.     or  publish the source code of this program in any form.   You
  13.     may  incorporate this code in object form in derivative  works
  14.     provided  such  derivative  works  are  (i.) are  designed and
  15.     intended  to  work  solely  with  Autodesk, Inc. products, and
  16.     (ii.)  contain  Autodesk's  copyright  notice  "(C)  Copyright
  17.     1988-1994 by Autodesk, Inc."
  18.  
  19.     AUTODESK  PROVIDES THIS PROGRAM "AS IS" AND WITH  ALL  FAULTS.
  20.     AUTODESK  SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF  MER-
  21.     CHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK,  INC.
  22.     DOES  NOT  WARRANT THAT THE OPERATION OF THE PROGRAM  WILL  BE
  23.     UNINTERRUPTED OR ERROR FREE.
  24.  
  25. */
  26. #ifndef MAINWND_H
  27. #define MAINWND_H
  28.  
  29. #include "HELLOADS.h"
  30.  
  31.  
  32. /******************************************************************************
  33. *                                                                             *
  34. *                            class WINDOW                                     *
  35. *                                                                             *
  36. ******************************************************************************/
  37. //-----------------------------------------------------------------------------
  38. class WINDOW : ADS_OBJ
  39. {
  40. protected:
  41.     HWND                hWnd;
  42.  
  43. public:
  44.     HWND                GetHandle( void ) { return hWnd; }
  45.  
  46.     BOOL                Show( int showcmd ) 
  47.                         { 
  48.                             return ShowWindow( hWnd, showcmd );
  49.                         }
  50.     void                Update( void ) 
  51.                         { 
  52.                             InvalidateRect( hWnd, NULL, TRUE );
  53.                             UpdateWindow( hWnd );
  54.                         }
  55.     virtual LRESULT     WndProc( UINT , WPARAM , LPARAM ) = 0;
  56.     virtual BOOL        Valid(){ return hWnd != NULL; }
  57. };
  58.  
  59. /******************************************************************************
  60. *                                                                             *
  61. *                          class MAINWINDO                                    *
  62. *                                                                             *
  63. ******************************************************************************/
  64. //-----------------------------------------------------------------------------
  65. class MAINWINDOW : public WINDOW
  66. {
  67. private:
  68.     static char         szClassName[14];
  69.     ADS_STRING          text;
  70.  
  71. public:
  72.     void                SetText( ADS_STRING& new_text ){ text = new_text; }
  73.     ADS_STRING&         Text() { return text; }
  74.     static BOOL         Register( void );
  75.     LRESULT             WndProc( UINT iMessage, WPARAM wParam, LPARAM lParam );
  76.                         MAINWINDOW();
  77.     void                Paint( void );
  78.     virtual BOOL        Valid()
  79.                         {
  80.                             return WINDOW::Valid(); 
  81.                         }
  82. };
  83.  
  84. #endif
  85.  
  86.